Skip to content

api.Notificaton.badge - Incorrectly marked as supported on Safari, wrong description in asterisk/notes #26861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rejhgadellaa opened this issue May 21, 2025 · 2 comments
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API p2 High priority – Community PRs highly encouraged.

Comments

@rejhgadellaa
Copy link

rejhgadellaa commented May 21, 2025

What type of issue is this?

Incorrect support data

What information was incorrect, unhelpful, or incomplete?

The Notification.badge property is incorrectly listed as supported in Safari (with an asterisk). Both macOS and iOS versions of Safari do not support the badge feature as described on the Notification: badge property page:

The badge read-only property of the Notification interface returns a string containing the URL of an image to represent the notification when there is not enough space to display the notification itself such as for example, the Android Notification Bar.
Notification: badge property

AFAIK, this is simply not supported at the OS's that Safari runs on.

Further more, when you click the asterisk, the description/note seems to confuse icon badging (the "unread badge" that is displayed on the app icon) with the actual Notification.badge feature:

Image

Badging is supported for web apps saved to the Dock in Safari 17 on the macOS Sonoma beta
Notification: badge property

Pages affected:

What browsers does this problem apply to, if applicable?

Safari

What did you expect to see?

Notification.badge should be listed as Not Supported for Safari on macOS and iOS. The incorrect asterisk information should be removed.

Did you test this? If so, how?

I tested this on Safari on several iOS Safari releases, among them 16.4 and 18.5

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

No response

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Notification/badge#browser_compatibility

MDN metadata

No response

@rejhgadellaa rejhgadellaa added the needs triage This issue needs to be confirmed label May 21, 2025
@caugner
Copy link
Contributor

caugner commented May 21, 2025

The data was added in #20088, and indeed it looks like that PR incorrectly associated the Notification.badge feature with the Badging API.

The WebKit source code suggests Notification.badge is not, and has not been supported: https://github.com/WebKit/WebKit/blame/main/Source/WebCore/Modules/notifications/Notification.idl#L59

So we should replace the Safari support statement with { version_added: false }:

"safari": {
"version_added": "17",
"notes": "Badging is supported for web apps saved to the Dock in Safari 17 on the macOS Sonoma beta"
},

@rejhgadellaa Would you like to open a PR with this change? 🙏

@caugner caugner changed the title Notificaton.badge - Incorrectly marked as supported on Safari, wrong description in asterisk/notes api.Notificaton.badge - Incorrectly marked as supported on Safari, wrong description in asterisk/notes May 21, 2025
@caugner caugner added data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API p2 High priority – Community PRs highly encouraged. and removed needs triage This issue needs to be confirmed labels May 21, 2025
@rejhgadellaa
Copy link
Author

Thanks! I'll have a look at making a PR for this, should have some time this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API p2 High priority – Community PRs highly encouraged.
Projects
None yet
Development

No branches or pull requests

2 participants